home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / t-bcinfo.zip / TI729.ZIP / TI729.ASC
Text File  |  1992-02-25  |  973b  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Borland C++                            NUMBER  :  729
  9.   VERSION  :  2.0
  10.        OS  :  DOS
  11.      DATE  :  February 25, 1992                        PAGE  :  1/1
  12.  
  13.     TITLE  :  How to Use strstream
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.   /*********************************************************
  26.  
  27.   Example code for using strstream
  28.  
  29.   *********************************************************/
  30.  
  31.   #include <stdio.h>       // the old C i/o stuff
  32.   #include <iostream.h>    // C++ streams
  33.   #include <strstream.h>
  34.  
  35.   char line[100];     // a buffer for lines of input
  36.  
  37.   void main(void)
  38.   {
  39.      ostrstream mystream(line, 100); // associate line[] with a
  40.                                         stream
  41.      mystream << "testing";          // insertion to mystream
  42.      printf("%s\n", line);           // output using old C style
  43.      cout << line;                   // output using C++ style
  44.   }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.